<style>
    .bordertop{border: 0;margin-top: 0;padding-top: 0; height: 3.8rem;line-height: 3.8rem;display: inline-block;width: 100%;font-size: 1.2rem;color: #000;text-decoration: none;  text-align: center;  }
    .Initiator div{ overflow: hidden;text-overflow:ellipsis;white-space: nowrap;margin-left: 20%; width: 100px;}
</style>

<div id="pklist">
    <div class="heading">
        <a href="#"><img src="resource/images/img-17-8.jpg" /></a>
        <?php echo $output['time']; ?>期PK榜
        <span onclick="location='index.php?act=bargain_pk&op=lottery_list'">中奖名单</span>
    </div>
    <table class="th">
        <tr>
            <th class="rank">排名</th>
            <th class="Initiator">发起者</th>
            <th class="tradeName">商品名</th>
            <th class="number">砍赞数</th>
        </tr>
    </table>

    <table class="tr">
        <?php if(!empty($output['pk_list']) && is_array($output['pk_list'])){ ?>
            <?php  foreach($output['pk_list'] as $k =>$v){ ?>

                <tr>
                    <td class="rank"><span><?php echo $k+1;?></span></td>
                    <td class="Initiator"><div><?php echo $v['nickname']; ?></div></td>
                    <td class="tradeName"><div><?php echo $v['bg_title']; ?></div></td>
                    <td class="number"><span><?php echo $v['in_all'];?></span></td>
                </tr>
            <?php } ?>
        <?php } ?>

    </table>
    <?php if($output['TotalNum']<=$output['TotalPage']){?>
        <a class="bordertop" onclick="loadpage();">查看更多</a>
    <?php } ?>
    <footer>
    </footer>







</div>
<script>
    var allNum = <?php echo $output['TotalNum']; ?>,
        allPage = <?php echo $output['TotalPage']; ?>,
        curPage = 1;

    var is_scroll = true;
    //ajax加载数据
    function loadpage() {
        if(!is_scroll){
            return;
        }
        if (curPage < allPage) {
            curPage += 1;
        } else {
            $('.bordertop').text('没有更多了!');
            return;
        }

        $.get(location.href, {isajax:1,curpage:curPage},function(data){
            if(data){
                $(".tr").append(data);
            }
        });
    }

</script>